<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div @click="flag=true">{{ww}}</div>
        <div v-for="item in arr" v-if="flag">
            <div @click="ww=item;flag = false">
                {{item}}
            </div>
        </div>
    </div>
</body>
<script src="/vue.js"></script>
<script>
    const { createApp, ref } = Vue
    createApp({
        setup() {
            let ww = ref('选项1')
            let arr = ref(['选项1', '选项2', '选项3', '选项4'])
            let flag = ref(false)
            return {
                ww,
                arr,
                flag
            }

        }
    }).mount("#app")
</script>

</html>